<template>
  <div class="loadHomeWork">
    <div class="loadHomeWorkIneer">
      <div class="loadTop">船泊统计</div>
      <div class="loadAndSearch">
        <div class="loadExcel">
          <div class="button" type="success" @click="uploadFile()">导入</div>
          <div class="button" type="success" @click="getExcelFile()">导出</div>
          <div class="button" type="success" @click="addOne()">新增</div>
          <div class="multiButton" type="success" @click="deleteMulti()">
            删除
          </div>
        </div>
        <div class="search">
          <input
            type="text"
            placeholder="请输入船型"
            v-model="shipTypeName1"
            @change="changeText"
          />
          <div class="searchButton" @click="getRenderList()">搜索</div>
        </div>
      </div>
      <div class="table" :style="{ width: tableWidth }">
        <el-table
          empty-text="暂无数据"
          :header-cell-style="{
            background: '#FAFAFA',
            color: '#777676 !important',
            fontWeight: '800',
          }"
          :data="tableData"
          border
          stripe
          style="width: 100%; height: auto"
          max-height="65vh"
          @selection-change="selecttableFunction"
          @row-dblclick="handleRowDblclick"
          :row-style="{ height: 30 + 'px' }"
          :cell-style="{ padding: 0 + 'px' }"
        >
          <el-table-column type="selection" width="35" align="center" />
          <el-table-column
            type="index"
            :index="indexNumber"
            label="序号"
            align="center"
            min-width="50"
          />

          <el-table-column
            prop="name"
            label="受注船名称"
            align="center"
            min-width="420"
          />
          <el-table-column
            prop="shipCompany"
            label="船公司"
            align="center"
            min-width="110"
          />
          <el-table-column
            prop="shipTypeName"
            label="船型"
            min-width="100"
            align="center"
          >
          </el-table-column>
          <el-table-column
            label="IMO"
            min-width="90"
            prop="imo_num"
            align="center"
          />

          <el-table-column
            prop="pipelineDiameter"
            label="管路口径"
            align="center"
            min-width="90"
          /><el-table-column
            prop="communicationInterface"
            label="通讯接口"
            align="center"
            min-width="90"
          />

          <el-table-column
            prop="qcdc"
            label="QCDC"
            align="center"
            min-width="85"
          />
          <el-table-column
            prop="esd_control_valve"
            label="ESD控制阀"
            align="center"
            min-width="95"
          />

          <el-table-column
            prop="saddlePosition"
            label="马鞍位置"
            align="center"
            min-width="85"
          />
          <el-table-column
            prop="fillStationPosition"
            label="加注站位置"
            align="center"
            min-width="110"
          />
        </el-table>
        <!-- 内容过多，会出现滚动条 -->
      </div>
      <div class="foot">
        <div class="currentPage">当前第{{ page }}/{{ totalPages }}页</div>
        <div
          class="lastPage"
          :style="{ background: color }"
          @click="clickLastPage()"
        >
          上一页
        </div>
        <div
          class="nextPage"
          :style="{ backgroundColor: color1 }"
          @click="clickNextPage()"
        >
          下一页
        </div>
        <div class="currentNumber">共{{ totalNumber }}条</div>
        <div>跳转至:</div>
        <input
          type="text"
          class="skipPage"
          style="width: 50px !important"
          v-model="shipPageNumer"
        />
        <div class="sureSkip" @click="skipPage">确定</div>
      </div>
    </div>
    <div class="dialog" ref="dialog" :style="{ display: show }">
      <div class="loadHomeWorkIneer">
        <div class="changeTop">
          <div
            class="delete"
            @click="deleteOne(id)"
            v-show="addOrEdit == '编辑'"
          >
            删除
          </div>
          <div class="sure" @click="sureAdd()">确认</div>
          <div class="cancel" @click="close()">取消</div>
        </div>
        <div class="dialogText">{{ addOrEdit }}</div>
        <div class="manyInput">
          <div class="iuptInnerContain">
            <div class="inputInner">
              <div class="name">受注船名:</div>
              <input type="text" placeholder="受注船名" v-model="name" />
            </div>
            <div class="inputInner">
              <div class="name">船公司:</div>
              <input type="text" placeholder="船公司" v-model="shipCompany" />
            </div>
            <div class="inputInner">
              <div class="name">船型:</div>
              <el-select
                class="mySelect"
                :no-data-text="'无数据'"
                v-model="shipTypeId"
                placeholder="船型"
                size="default"
                style="width: 220px; margin-left: 5px"
              >
                <el-option
                  v-for="item in shipTypeIdList"
                  :label="item.shipTypeNum"
                  :value="item.id"
                />
              </el-select>
            </div>
            <div class="inputInner">
              <div class="name">IMO:</div>
              <input
                type="text"
                name=""
                id=""
                placeholder="IMO"
                v-model="imo_num"
              />
            </div>
            <div class="inputInner">
              <div class="name">管路口径:</div>
              <input
                type="text"
                name=""
                id=""
                placeholder="管路口径"
                v-model="pipelineDiameter"
              />
            </div>
            <div class="inputInner">
              <div class="name">通讯接口:</div>
              <input
                type="text"
                name=""
                id=""
                placeholder="通讯接口"
                v-model="communicationInterface"
              />
            </div>
            <div class="inputInner">
              <div class="name">QCDC:</div>
              <input
                type="text"
                name=""
                id=""
                placeholder="QCDC"
                v-model="qcdc"
              />
            </div>
            <div class="inputInner">
              <div class="name">ESD控制阀:</div>
              <input
                type="text"
                name=""
                id=""
                placeholder="ESD控制阀"
                v-model="esd_control_valve"
              />
            </div>
            <div class="inputInner">
              <div class="name">马鞍位置:</div>
              <input
                type="text"
                name=""
                id=""
                placeholder="马鞍位置"
                v-model="saddlePosition"
              />
            </div>
            <div class="inputInner">
              <div class="name">加注站位置:</div>
              <input
                type="text"
                name=""
                id=""
                placeholder="加注站位置"
                v-model="fillStationPosition"
              />
            </div>
            <div class="inputInner">
              <div class="name">最后一次加注时间:</div>

              <div class="inputContainer">
                <el-config-provider :locale="locale">
                  <el-date-picker
                    v-model="lastFillDate"
                    type="date"
                    placeholder="最后一次加注时间"
                    format="YYYY/MM/DD"
                    value-format="YYYY/MM/DD"
                  />
                </el-config-provider>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="dialog1" ref="dialog" :style="{ display: show1 }">
      <div class="loadHomeWorkIneer">
        <div class="dialogText">{{ addOrEdit }}</div>
        <div class="manyInput">
          <div class="iuptInnerContain">
            <div class="inputInner">
              <div class="name">受注船名:</div>
              <div class="name1">{{ name }}</div>
            </div>
            <div class="inputInner">
              <div class="name">船公司:</div>
              <div class="name1">{{ shipCompany }}</div>
            </div>
            <div class="inputInner">
              <div class="name">船型:</div>
              <div class="name1">{{ shipTypeName }}</div>
            </div>
            <div class="inputInner">
              <div class="name">IMO:</div>
              <div class="name1">{{ imo_num }}</div>
            </div>
            <div class="inputInner">
              <div class="name">管路口径:</div>
              <div class="name1">{{ pipelineDiameter }}</div>
            </div>
            <div class="inputInner">
              <div class="name">通讯接口:</div>
              <div class="name1">{{ communicationInterface }}</div>
            </div>
            <div class="inputInner">
              <div class="name">QCDC:</div>
              <div class="name1">{{ qcdc }}</div>
            </div>
            <div class="inputInner">
              <div class="name">ESD控制阀:</div>
              <div class="name1">{{ esd_control_valve }}</div>
            </div>
            <div class="inputInner">
              <div class="name">马鞍位置:</div>
              <div class="name1">{{ saddlePosition }}</div>
            </div>
            <div class="inputInner">
              <div class="name">加注站位置:</div>
              <div class="name1">{{ fillStationPosition }}</div>
            </div>
            <div class="inputInner">
              <div class="name">最近一次加注时间:</div>
              <div class="name1">
                {{ lastFillDate ? reduceDate(lastFillDate) : "" }}
              </div>
            </div>
          </div>
        </div>
        <div class="closeAndSrue1">
          <div class="button" @click="close()">关闭</div>
        </div>
      </div>
    </div>
    <div class="dialog2" :style="{ display: uploadfile }">
      <div class="upContain">
        <input
          type="file"
          ref="clearFile"
          class="addfile"
          @change="getFile($event)"
          accept=".xls,.xlsx"
        />
      </div>
      <div class="fileName">
        <div v-show="fileName">文件名:{{ fileName }}</div>
      </div>
      <div class="upFileSrue">
        <button class="buttonUpdata" @click="cancelUp()">取消</button>
        <button class="buttonUpdata buttonUpdata1" @click="submitAddFile()">
          确定
        </button>
      </div>
    </div>
  </div>
</template>

<script>
import EventBus from "@/mitt/eventBus.js";
import rename from "@/mitt/getPath.js";
import service from "@/api/api";
import $ from "jquery";
import zhCn from "element-plus/es/locale/lang/zh-cn";

import axios from "axios";
export default {
  name: "",
  data() {
    return {
      shipPageNumer: 1,
      multi: [],
      locale: zhCn,
      token: "",
      tableData: [],
      tableWidth: null,
      page: 1,
      size: 20,
      show: "none",
      addOrEdit: "新增",
      currentNum: 0,
      totalNumber: 0,
      name: "",
      shipCompany: "",
      shipTypeName: "",
      imo_num: "",
      pipelineDiameter: "",
      communicationInterface: "",
      qcdc: "",
      esd_control_valve: "",
      saddlePosition: "",
      fillStationPosition: "",
      lastFillDate: "",
      shipTypeId: "船型",
      id: "",
      totalPages: null,
      uploadfile: true,
      data: {
        name: "",
        shipCompany: "",
        shipTypeName: "",
        imo_num: "",
        shipTypeId: 0,
        pipelineDiameter: "",
        communicationInterface: "",
        qcdc: "",
        esd_control_valve: "",
        saddlePosition: "",
        fillStationPosition: "",
        lastFillDate: "",
        id: "",
      },
      show1: "none",
      color: "#EBEBEB",
      color1: "#EBEBEB",
      file: null,
      fileName: "",
      jtData: null,
      shipTypeIdList: [],
      shipTypeName1: "",
    };
  },
  props: [],
  components: {},
  computed: {},
  filters: {},

  methods: {
    indexNumber(index) {
      return (this.page - 1) * this.size + index + 1;
    },
    handleRowDblclick(row) {
      this.clickEdit(row.id);
    },
    skipPage() {
      if (this.shipPageNumer <= this.totalPages && this.shipPageNumer > 0) {
        this.page = this.shipPageNumer;
        this.getRenderList();
      } else {
        this.$message({
          type: "warning",
          message: "超出页面数量范围",
        });
      }
    },
    // 批量删除开始========================
    selecttableFunction(row) {
      if (row.length > 0) {
        this.multi = [];
        row.forEach((element) => {
          this.multi.push(element.id);
        });
      } else {
        this.multi = [];
      }
    },
    deleteMulti() {
      // let that = this;
      if (this.multi.length == 0) {
        return this.$message({
          type: "warning",
          message: "请先选中再进行批量删除操作！",
        });
      }
      let data = {
        idList: this.multi + "",
      };

      this.$alert("确定删除选中的信息？", {
        confirmButtonText: "确定",
        callback: (action) => {
          if (action == "confirm") {
            service({
              method: "delete",
              url: `/ship`,
              params: data,
            }).then((r) => {
              if (r.status == "SUCCESS") {
                this.$message({
                  type: "success",
                  message: "删除成功",
                });
                if (this.currentNum == this.multi.length && this.page > 1) {
                  this.page--;
                }
                this.getRenderList();
              }
            });
          } else {
            this.$message({
              type: "info",
              message: "取消删除",
            });
          }
        },
      });
    },
    //批量删除结束=============================
    formatDate(row, column) {
      // 获取单元格数据
      let data = row[column.property];
      if (data == null) {
        return null;
      }
      let date = new Date(data);
      let year = date.getFullYear();
      let month = date.getMonth() + 1;
      let day = date.getDate();
      return `${year}/${month}/${day}`;
    },
    formatincludeFlag(row, column) {
      // 获取单元格数据
      let data = row[column.property];
      if (data == null) {
        return null;
      }
      if (data == 0) {
        return "否";
      } else if (data == 1) {
        return "是";
      }
    },
    customIndex(index) {
      return (this.page - 1) * this.size + index + 1;
      // 自定义序号显示，比如增加分页后的偏移量
      // return (this.page - 1) * this.size + index + 1;
    },
    // 导入文件================
    uploadFile() {
      this.uploadfile = "block";
    },
    getFile(event) {
      this.file = event.target.files[0];
      this.fileName = this.file.name;
    },
    submitAddFile() {
      if (this.file) {
        let data = {
          file: this.file,
        };
        service({
          method: "post",
          url: "/ship/upload",
          headers: {
            "Content-Type": "multipart/form-data",
          },
          data: data,
        })
          .then((res) => {
            document.getElementsByClassName("addfile")[0].value = "";

            this.$message({
              message: "上传成功",
              type: "success",
            });
            this.file = "";
            this.fileName = "";
            this.uploadfile = "none";
            this.getRenderList();
          })
          .catch((err) => {

            this.$message({
              message: err,
              type: "fail",
            });
          });
      } else {
        this.$message({
          message: "请先选择文件再上传",
          type: "warning",
        });
      }
    },
    cancelUp() {
      this.file = "";
      this.fileName = "";
      this.uploadfile = "none";
    },
    // 导入文件结束=============
    clickEdit(a) {
      this.addOrEdit = "编辑";

      this.tableData.forEach((item) => {
        if (item.id == a) {
          this.name = item.name;
          this.shipCompany = item.shipCompany;
          this.shipTypeName = item.shipTypeName;
          this.shipTypeId = item.shipTypeId;
          this.imo_num = item.imo_num;
          this.pipelineDiameter = item.pipelineDiameter;
          this.communicationInterface = item.communicationInterface;
          this.qcdc = item.qcdc;
          this.esd_control_valve = item.esd_control_valve;
          this.fillStationPosition = item.fillStationPosition;
          this.lastFillDate = item.lastFillDate;
          this.saddlePosition = item.saddlePosition;
          this.id = a;
        }
        this.show = "block";
      });
    },

    // 删除数据
    deleteOne(a) {
      // let that = this;
      this.$alert("确定删除这条信息？", {
        confirmButtonText: "确定",
        callback: (action) => {
          if (action == "confirm") {
            service({
              method: "delete",
              url: `/ship/${a}`,
            })
              .then((r) => {
                if (r.status == "SUCCESS") {
                  this.$message({
                    type: "success",
                    message: "删除成功",
                  });
                  if (this.currentNum == 1 && this.page > 1) {
                    this.page--;
                  }
                  this.getRenderList();
                  this.show = "none";
                }
              })
              .catch((err) => {
                this.$message({
                  type: "danger",
                  message: "出错了！",
                });
              });
          } else {
            this.$message({
              type: "info",
              message: "取消删除",
            });
          }
        },
      });
    },
    // 弹窗确认按钮

    sureAdd() {
      this.shipTypeIdList.forEach((item) => {
        if (this.shipTypeId == item.id) {
          this.shipTypeName = item.shipType;
        }
      });

      this.data.name = this.name;
      this.data.shipCompany = this.shipCompany;
      this.data.shipTypeId = this.shipTypeId;
      this.data.shipTypeName = this.shipTypeName;
      this.data.imo_num = this.imo_num;
      this.data.pipelineDiameter = this.pipelineDiameter;
      this.data.communicationInterface = this.communicationInterface;
      this.data.qcdc = this.qcdc;
      this.data.esd_control_valve = this.esd_control_valve;
      this.data.fillStationPosition = this.fillStationPosition;
      this.data.lastFillDate = this.lastFillDate;
      this.data.saddlePosition = this.saddlePosition;
      this.data.id = this.id;

      if (this.addOrEdit == "编辑") {
        service({
          method: "put",
          data: this.data,
          url: "/ship",
        })
          .then((r) => {
            if (r.status == "SUCCESS") {
              this.$message({
                type: "success",
                message: "修改成功",
              });
              this.getRenderList();
              this.show = "none";
              this.clearCanShu();
            }
          })
          .catch((err) => {
            this.$message({
              type: "info",
              message: "出错了！",
            });
          });
      } else {
        service({
          method: "post",
          data: this.data,
          url: "/ship",
        })
          .then((r) => {
            if (r.status == "SUCCESS") {
              this.$message({
                type: "success",
                message: "新增成功",
              });
              this.getRenderList();
              this.show = "none";
              this.clearCanShu();
            }
          })
          .catch((err) => {
            this.$message({
              type: "info",
              message: "出错了！",
            });
          });
      }
    },
    reduceDate(a) {
      let date = new Date(a);
      let year = date.getFullYear();
      let month = date.getMonth() + 1;
      let day = date.getDate();
      return `${year}-${month}-${day}`;
    },
    // 关闭弹窗
    close() {
      this.show = "none";
      this.show1 = "none";
      this.clearCanShu();
      $("#datepicker").datepicker("destroy");
      $("#datepicker1").datepicker("destroy");
    },
    // 获取所有船型
    async getAllShip() {
      let that = this;
      await service({
        methods: "get",
        url: "/ship-type/find-all",
      })
        .then((e) => {
          that.shipTypeIdList = e.data;
        })
        .catch((r) => {});
    },
    // 新增
    addOne() {
      this.clearCanShu();
      this.shipTypeId = "";
      this.addOrEdit = "新增";
      // this.$refs["dialog"].style.display = show;
      this.show = "block";
    },
    // 导出文件
    getFileName() {
      let date = new Date();
      let year = date.getFullYear().toString();
      let month =
        date.getMonth() + 1 > 9
          ? date.getMonth() + 1
          : "0" + (date.getMonth() + 1);
      let day =
        date.getDate() > 10 ? date.getDate().toString() : "0" + date.getDate();
      let hour =
        date.getHours() > 10
          ? date.getHours().toString()
          : "0" + date.getHours();
      let min =
        date.getMinutes() > 10
          ? date.getMinutes().toString()
          : "0" + date.getMinutes();

      date = null;
      return `${year}${month}${day}${hour}${min}`;
    },
    async getExcelFile() {
      let that = this;
      let time = this.getFileName();
      this.token = sessionStorage.getItem("token");
      this.token = JSON.parse(this.token);
      axios({
        method: "get",
        url: this.$loadFile + "/ship/export",
        responseType: "blob", // 关键：设置响应类型为blob
        data: {
          fileName: "船舶统计",
        },
        headers: {
          token: that.token,
        },
      })
        .then((response) => {
          const url = window.URL.createObjectURL(new Blob([response.data]));
          // 创建一个隐藏的<a>标签，并设置其href属性为上面创建的URL
          const link = document.createElement("a");
          link.href = url;
          link.download = "船舶统计-" + time + ".xls"; // 替

          document.body.appendChild(link);

          link.click();

          document.body.removeChild(link);

          window.URL.revokeObjectURL(url);
        })
        .catch((error) => {
          this.$message({
            message: "文件下载失败",
            type: "info",
          });
        });
    },
    sendMessage() {
      let res = rename();
      EventBus.emit("custom-event", res);
    },
    // 获取列表数据
    async getRenderList() {
      let data = {};
      if (this.shipTypeName1) {
        data = {
          page: this.page,
          size: this.size,
          shipTypeName: this.shipTypeName1,
        };
      } else {
        data = {
          page: this.page,
          size: this.size,
        };
      }

      await service({
        methods: "get",
        url: "/ship/find-one-page",
        params: data,
      })
        .then((e) => {
          this.totalPages = e.data.totalPages;
          this.totalNumber = e.data.totalElements;
          if (this.totalPages == 0) {
            this.totalPages = 1;
          }
          if (this.page < this.totalPages) {
            this.color1 = "#268FDE";
          } else {
            this.color1 = "#EBEBEB";
          }
          if (this.page == 1) {
            this.color = "#EBEBEB";
          } else {
            this.color = "#268FDE";
          }
          this.tableData = e.data.content;
          this.currentNum = e.data.numberOfElements;
        })
        .catch((err) => {});
    },
    formatterDate(a) {
      let date = new Date(a);
      let year = date.getFullYear();
      let month = date.getMonth() + 1;
      let day = date.getDate();
      return `${year}/${month}/${day}`;
    },
    clearCanShu() {
      this.data = {
        shipTypeId: 0,
        name: "",
        shipCompany: "",
        shipTypeName: "",
        imo_num: "",
        pipelineDiameter: "",
        communicationInterface: "",
        qcdc: "",
        esd_control_valve: "",
        fillStationPosition: "",
        lastFillDate: "",
        saddlePosition: "",
        id: "",
      };
      this.name = "";
      this.shipCompany = "";
      this.shipTypeName = "";
      this.imo_num = "";
      this.shipTypeId = 0;
      this.pipelineDiameter = "";
      this.communicationInterface = "";
      this.qcdc = "";
      this.esd_control_valve = "";
      this.fillStationPosition = "";
      this.lastFillDate = "";
      this.saddlePosition = "";
      this.id = "";
    },
    clickSee(a) {
      this.addOrEdit = "查看";
      this.tableData.forEach((item) => {
        if (item.id == a) {
          this.name = item.name;
          this.shipCompany = item.shipCompany;
          this.shipTypeName = item.shipTypeName;
          this.shipTypeId = item.shipTypeId;
          this.imo_num = item.imo_num;
          this.pipelineDiameter = item.pipelineDiameter;
          this.communicationInterface = item.communicationInterface;
          this.qcdc = item.qcdc;
          this.esd_control_valve = item.esd_control_valve;
          this.fillStationPosition = item.fillStationPosition;
          this.lastFillDate = item.lastFillDate;
          this.saddlePosition = item.saddlePosition;
          this.id = a;
        }
        this.shipTypeIdList.forEach((item) => {
          if (this.shipTypeId == item.id) {
            this.shipTypeName = item.shipType;
          }
        });
        this.show1 = "block";
      });
    },

    clickLastPage() {
      if (this.page > 1) {
        this.page--;
        if (this.page == 1) {
          this.color = "#EBEBEB";
        } else {
          this.color = "#268FDE";
        }
        if (this.page < this.totalPages) {
          this.color1 = "#268FDE";
        }
        this.getRenderList();
      } else {
        this.color = "#EBEBEB";
      }
    },
    clickNextPage() {
      if (this.page < this.totalPages) {
        this.page++;
        this.color = "#268FDE";
        if (this.page == this.totalPages) {
          this.color1 = "#EBEBEB";
        } else {
          this.color1 = "#268FDE";
        }
      }
      this.getRenderList();
    },
    handSize() {
      if (window.innerWidth > 630) {
        if (this.$store.state.width == 200) {
          this.tableWidth = (window.innerWidth - 170) * 0.985 - 20 + "px";
        } else if (this.$store.state.width == 90) {
          this.tableWidth = (window.innerWidth - 60) * 0.985 - 20 + "px";
        }
      } else {
        this.tableWidth = window.innerWidth - 30 + "px";
      }
    },
  },
  watch: {
    "$store.state.width"(newVal, oldVal) {
      //对数据执行操作
      if (window.innerWidth > 630) {
        if (newVal == 90) {
          this.tableWidth = (window.innerWidth - 60) * 0.985 - 20 + "px";
        } else if (newVal == 200) {
          this.tableWidth = (window.innerWidth - 170) * 0.985 - 20 + "px";
        }
      }
    },
  },

  created() {
    this.sendMessage();
    this.getRenderList();
    this.getAllShip();
  },
  beforeMount() {
    if (window.innerWidth > 630) {
      if (this.$store.state.width == 200) {
        this.tableWidth = (window.innerWidth - 170) * 0.985 - 20 + "px";
      } else if (this.$store.state.width == 90) {
        this.tableWidth = (window.innerWidth - 60) * 0.985 - 20 + "px";
      }
    } else {
      this.tableWidth = window.innerWidth - 30 + "px";
    }
  },
  mounted() {
    let that = this;

    // this.sendMessage();
    window.addEventListener("resize", this.handSize);
  },
  beforeUnmount() {
    window.removeEventListener("resize", this.handSize);
  },
};
</script>
<style lang="less" scoped>
.manyInput {
  width: 780px;
  height: 80vh;
  overflow: auto;
  // overflow: auto;
  // background: red;
  margin: auto;

  // overflow: scroll;
  .iuptInnerContain {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    .inputInner {
      width: 375px;
      min-height: 35px;
      // background: blue;
      margin-right: 10px;
      margin-top: 10px;
      display: flex;
      align-items: center;
      // justify-content: space-between;
      color: #365488;
      .name {
        width: 150px;
        height: 100%;
        // line-height: 4vh;
        text-align: right;
        font-size: 15px;
      }
      // .name1 {
      //   width: 210px;
      //   margin-left: 10px;
      //   height: 3vh;
      //   line-height: 3vh;
      //   text-indent: 1em;
      //   outline: none;
      //   font-size: 15px;
      //   border: none;
      //   background: #ebebeb;
      //   color: #365488;
      // }

      .inputContainer {
        width: 210px;
        margin-left: 5px;
      }
      .el-input__inner {
        background: white !important;
      }
      .mySelect {
        .el-input__inner {
          height: 34px;
        }
        /* 下面设置右侧按钮居中 */
        .el-input__suffix {
          top: 5px;
        }
        .el-input__icon {
          line-height: inherit;
        }
        .el-input__suffix-inner {
          display: inline-block;
        }
      }
      input {
        width: 220px;
        height: 34px;
        margin-left: 5px;
        border-radius: 5px;
        text-indent: 1em;
        outline: none;
        border: none;
        background: white !important;
        color: #365488;
        border: 1px solid #dcdfe6;
      }
      input::-webkit-input-placeholder {
        color: #a8abb2;
      }
      input[type="date"] {
        // padding: 5px;
        color: #365488;
        text-align: left;
        // border: 1px solid #365488;
        border-radius: 4px;
        // background-color: #fff;
        box-sizing: border-box; /* 确保内边距和边框不会影响元素的总宽度 */
      }
      // input[type="number"] {
      //   appearance: textfield;
      //   -moz-appearance: textfield;
      // }
      // 　　input[type="number"]::-webkit-inner-spin-button,
      // 　　input[type="number"]::-webkit-outer-spin-button {
      //   -webkit-appearance: none;
      //   margin: 0;
      // }
    }
    .el-date-picker .el-picker-panel {
      background-color: white !important; /* 你想要的背景颜色 */
    }
  }
}
.dialogText {
  margin: auto;
  width: 50%;
  line-height: 4vh;
  font-size: 25px;
  color: black;
  // text-indent: 10px;
  text-align: center;
  // font-size: 20px;
  font-weight: 800;
}

.dialog,
.dialog1 {
  width: 100%;
  height: 100%;
  background: #dfe6e8;
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  z-index: 100;
}
.loadHomeWork {
  overflow: hidden;
  width: 100%;
  height: 100%;
  position: relative;
  .loadHomeWorkIneer {
    width: 98.5%;
    height: 91vh;
    margin: auto;
    margin-top: 1vh;
    background: white;

    .loadAndSearch {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
    }
  }
  // background: blue;
}
.table {
  width: 98.5%;
  margin: auto;
  // margin-top: 2vh;
  height: 65vh;
  // background: red;
  .tableTop {
    width: 100%;
    height: 8vh;
    background: #f6f8f8;
    border-top: 1px solid #dfe6e8;
    border-right: 1px solid #dfe6e8;
    border-bottom: 1px solid #dfe6e8;
    color: rgba(0, 0, 0, 0.685);
    display: flex;
    // align-items: floor;
    .line {
      border-left: 1px solid #dfe6e8;
      width: 5%;
      height: 8vh;

      display: flex;
      align-items: flex-end;
      justify-content: center;
      padding-bottom: 5px;
    }
    .workNum,
    .workPlace,
    .workShip,
    .workStart,
    .workEnd,
    .workRecond {
      width: 8%;
    }

    .workpower {
      width: 18%;
      display: block;
      .loadNum {
        width: 100%;
        height: 3vh;
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom: 1px solid #dfe6e8;
      }
      .loadcate {
        width: 100%;
        height: 5vh;
        text-align: center;
        display: flex;
        // align-items: flex-end;
        // border-bottom: 1px solid black;
        .small {
          width: 33%;
          height: 100%;
          line-height: 2vh;
          border-right: 1px solid #dfe6e8;
          // line-height: 2vh;
          display: flex;
          align-items: flex-end;
          justify-content: center;
          padding-bottom: 0.3vh;
        }
        .small:nth-child(1) {
          width: 35%;
        }
        .small:nth-child(2) {
          width: 33%;
        }
        .small:nth-child(3) {
          width: 32%;
          border-right: none;
        }
      }
    }
    .opt {
      width: 15%;
    }
  }
  .tableLine {
    max-height: 65vh;
    border-top: none;
    // background: red;
    .tableEveryLine {
      width: 100%;
      height: 4vh;
      background: #f6f8f8;
      // border-top: 1px solid #dfe6e8;
      border-right: 1px solid #dfe6e8;
      border-bottom: 1px solid #dfe6e8;
      color: rgba(0, 0, 0, 0.685);
      display: flex;
      .line {
        border-left: 1px solid #dfe6e8;
        width: 5%;
        height: 4vh;

        display: flex;
        align-items: center;
        justify-content: center;
        padding-bottom: 5px;
      }
      .workNum,
      .workPlace,
      .workShip,
      .workStart,
      .workEnd,
      .workRecond {
        width: 8%;
      }

      .workpower {
        width: 18%;
        .small {
          width: 33%;
          height: 4vh;
          border-right: 1px solid #dfe6e8;
          // line-height: 2vh;
          display: flex;
          align-items: center;
          justify-content: center;
        }
        .small:nth-child(1) {
          width: 35%;
          border-right: 1px solid #dfe6e8;
        }
        .small:nth-child(2) {
          width: 33%;
        }
        .small:nth-child(3) {
          width: 32%;
          border-right: none;
        }
      }
      .opt {
        width: 15%;
        display: flex;
        align-items: center;
        justify-content: space-around;
        button {
          width: 25%;
          line-height: 3vh;
          border-radius: 0.5vh;
          border: none;
          outline: none;
          color: white;
        }
        .button:nth-child(1) {
          background: #7266ba;
        }
        .button:nth-child(2) {
          background: #23b7e5;
        }
        .button:nth-child(3) {
          background: red;
        }
      }
    }
  }
}

.rigth {
  flex-grow: 1;
  height: 100vh;
  // background: blue;
  .rightTop {
    width: 100%;
    height: 7vh;
    display: flex;
    // background: #3359c7;
    align-items: center;
    justify-content: space-between;
    .topLeft {
      width: 460px;
      display: flex;
      align-items: center;
      height: 100%;
      .changeButton {
        margin-left: 10px;
        width: 40px;
        height: 2.8vh;
        color: #163fb1;
      }
      .NavChangeName {
        // margin-left: 10px;
        font-size: 20px;
        color: #365488;
        width: 140px;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: flex-start;
      }
    }
    .topRight {
      width: 250px;
      height: 100%;
      display: flex;
      position: relative;
      align-items: center;
      // background: red;
      .bell,
      .share {
        color: #3359c7;
        position: relative;
        display: flex;
        align-items: center;
        .messageCircle {
          width: 40px;
          height: 40px;
          display: flex;
          align-items: center;
          justify-content: center;
          border-radius: 50%;
          background: red;
          color: white;
          position: absolute;
          top: -2.4vh;
          left: 0vw;
          transform: scale(0.5);
        }
      }
      .share,
      .avater {
        margin-left: 10px;
      }
      .avater {
        width: 150px;
        height: 100%;
        // background: red;
        display: flex;
        align-items: center;
        .pic {
          width: 50px;
          height: 50px;
          border-radius: 50%;
          overflow: hidden;
          img {
            width: 100%;
            height: 100%;
          }
        }
        .userName {
          margin-left: 10px;
          width: 90px;
          height: 100%;
          position: relative;
          display: flex;
          align-items: center;
          color: #3359c7;
          font-size: 15px;
        }
      }
      .quit {
        width: 150px;
        text-align: center;
        line-height: 40px;
        background: #3359c7;
        position: absolute;
        z-index: 100;
        color: white;
        font-size: 20px;
        right: 0px;
        top: 7vh;
      }
    }
  }
  .rightInner {
    width: 100%;
    height: 93%;
    background: #ebebeb;
  }
}
@media (min-width: 0px) and (max-width: 960px) {
  .manyInput {
    width: 375px !important;
    display: block !important;
    .inputInner {
      margin: auto !important;
      margin-top: 10px !important;
    }
  }
}
</style>
